Method and system for visually indicating a selection query

ABSTRACT

A method and system for specifying a selection query for a collection of data items. The system allows a user to define various conditions (e.g., &#34;Supervisor=Smith&#34;) that relate to the collection. A unique icon is then assigned to represent each condition. These icons can either be assigned automatically by the system or assigned by a user. When a selection query is to be specified, the system displays a selection query grid. The selection query grid contains a row for each possible combination of the defined conditions. Each possible combination is represented by displaying the icons for the conditions in that combination in the row. A user can then select which combinations should form the selection query by selecting rows of the selection query grid. The selection query is the logical-AND of each condition or logical inverse of each condition of a selected combination and the logical-OR of all the selected combinations. The system then uses this selection query to retrieve the data items from the collection.

TECHNICAL FIELD

The present invention relates generally to information retrieval and, more particularly, to specifying a selection query for information to be retrieved.

BACKGROUND OF THE INVENTION

Information retrieval is one of the primary uses of computer systems. To retrieve certain information from a collection of data, an information retrieval system receives a specification of a selection query and then applies the selection query to the collection so that data that satisfies the selection query can be retrieved. For example, the collection of data may be a database table that contains records with various fields. A selection query would specify which records of the table are to be selected based on the value of fields in the records. For example, if the table contains a record for each employee in a company, the fields may include employee name, department, supervisor, and salary. A typical selection query may specify to select all records for employees whose supervisor is Smith. A user may specify such a selection query by entering:

    Supervisor=Smith

An information retrieval system would select the records that satisfy this selection query and then retrieve the selected records.

Although the specifying of such a selection query is straightforward, it is much more difficult for a user to specify a more complex selection query. For example, if a user wants to retrieve all the records for employees who are in the marketing department but whose supervisor is not Smith and for employees who are in the accounting department, then a user would specify such a selection query by entering:

    (Department=Marketing AND Supervisor≠Smith) OR (Department-Accounting)

Such selection queries are generally specified using Boolean logic. However, unless a user has had formal training in Boolean logic, the user may not fully understand the meaning of the various logic relations. In particular, users often confuse the logical-AND and logical-OR Boolean relations. In the example above, a user who is confused may incorrectly specify the selection query by entering:

    (Department=Marketing AND Supervisor≠Smith) AND (Department=Accounting)

Although the second logical-AND would seem to be consistent with the statement "and for the employees who are in the accounting department," the use of such a logical-AND is incorrect. Also, users often do not fully understand the use of parentheses and find them cumbersome to use. In addition, the use of parentheses is a major source of errors in specifying selection queries by even those who understand Boolean logic. For example, a user may specify the selection query by entering:

    Department=Accounting OR Supervisor≠Smith AND Department=Marketing

If the logical-AND and a logical-OR have equal precedence, then this selection query would specify to select the employees who are in both the accounting and marketing departments and the employees whose supervisor is not Smith and are in the marketing department. In other words, only employees who are in the marketing department and also who are in the accounting department or also whose supervisor is not Smith are selected. This specification does not correctly reflect the user's intention to select all employees in the accounting department.

Several techniques have been developed to help users specify a selection query. Two such techniques are Query-By-Example (QBE) and Venn diagrams. FIGS. 1A and 1B illustrate the use of Query-By-Example. QBE presents columns for various fields of a table and allows a user to enter the selection query into the columns. For example, to specify a selection query for all employees whose supervisor is Smith, the user enters "Smith" into the appropriate column as shown in FIG. 1A. To specify a selection query for all employees who are in the marketing department but whose supervisor is not Smith and for all employees who are in the accounting department, the user enters "≠Smith" and "Marketing" into the appropriate columns of the same row and enters "Accounting" into the appropriate column of another row as shown in FIG. 1B. The conditions (e.g., "Supervisor≠Smith") in a single row are logically-AND'd and the conditions in different rows are logically-OR'd to form the selection query. FIGS. 2A and 2B illustrate the use of Venn diagrams. After a user has specified a selection query, a Venn diagram can be displayed to help the user understand how the information retrieval system is interpreting the selection query. FIG. 2A shows the Venn diagram corresponding to the selection query of FIG. 1A. The circle represents all employees and the shaded region indicate those employees specified by the selection query. FIG. 2B shows the Venn diagram corresponding to the selection query of FIG. 1B. Each circle represents all employees. The shaded region in circle 201 indicates those employees who are in the marketing department and whose supervisor is not Smith. The shaded region in circle 202 indicates the employees in the accounting department. If the Venn diagram indicates that the selection query does not specify the records that the user intends to retrieve, the user can re-specify the selection query.

Selection queries can be used to specify retrieval from a variety of collections of data. These collections can include tables in a database system, files in a file system, documents in a document management system, and Web pages on the World Wide Web. The relations in the selection queries are typically adapted to the type of data in the collection. For example, if a database table contains numerical data, then numerical relations (e.g., "≧") would be used. Also, the selection queries for documents may specify proximity relations (e.g., a certain word near another word or two words in the same sentence).

Information retrieval is especially fundamental to users of the World Wide Web (WWW). The WWW comprises thousands of computer whose information data can be retrieved by users of the WWW. Various WWW information retrieval systems are known as "search engines." These search engines typically require users to specify selection queries by entering conditions and Boolean relation. However, access to the WWW is increasingly becoming available to everyone. Since the vast majority of people do not fully understand Boolean logic, the specifying of the intended selection query has been problematic. It would be desirable to have a technique for specifying selection queries that would allow a typical user to correctly specify the intended selection query.

SUMMARY OF THE INVENTION

The present invention provides a method and system for specifying a selection query for a collection of data items. The system allows a user to define various conditions (e.g., "Supervisor=Smith") that relate to the collection. A unique icon is then assigned to represent each condition. These icons can either be assigned automatically by the system or assigned by a user. When a selection query is to be specified, the system displays a selection query grid. The selection query grid contains a row for each possible combination of the defined conditions. Each possible combination is represented by displaying the icons for the conditions in that combination in the row. A user can then select which combinations should form the selection query by selecting rows of the selection query grid. The selection query is the logical-AND of each condition of a selected combination and the logical-OR of all the selected combinations. The system then uses this selection query to retrieve the data items from the collection.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B illustrate the use of Query-By-Example.

FIGS. 2A and 2B illustrate the use of the Venn diagrams.

FIG. 3 is a diagram illustrating an example of how a user uses the VQL system to define a tagged retrieval type.

FIG. 4 is a diagram illustrating another example of how a user uses the VQL system to define a tagged retrieval type.

FIG. 5 is a diagram illustrating the specifying of a selection query using a selection query grid.

FIGS. 6A and 6B are diagrams illustrating an example of how a user uses the VQL system to define a compound tag.

FIG. 7 is a diagram illustrating both suggestive icons for tags and exclusive tags.

FIG. 8 is a diagram illustrating the relative preferences of tags.

FIG. 9 is a block diagram of a computer system embodying the present invention.

FIG. 10 is a flow diagram of an implementation of the tag component.

FIG. 11 is a flow diagram of an implementation of a define simple tag routine.

FIG. 12 is a flow diagram of an implementation of a define compound tag routine.

FIG. 13 is a flow diagram of an implementation of a selection query routine.

DETAILED DESCRIPTION OF THE INVENTION

The present invention provides a visual query method and system, referred to as the Visual Query Language (VQL) system, for specifying a selection query for a collection of data. The VQL system allows a user to define various "tagged retrieval types." A tagged retrieval type (i.e., tag) specifies a selection condition (e.g., "Supervisor≠Smith") that can be combined with other selection conditions to specify a selection query. A user can define various tags representing different selection conditions. When a user indicates that a selection query is to be specified, the VQL system displays a selection query grid with a row for each possible combination of the defined tags. For example, if three tags have been defined, then the selection query grid has 8 (2³) rows. The following table illustrates all possible combinations of three tags displayed in a selection query grid.

    ______________________________________     Tag.sub.1       Tag.sub.2                            Tag.sub.3     ______________________________________     0               0      0     1               0      0     0               1      0     0               0      1     1               1      0     1               0      1     0               1      1     1               1      1     ______________________________________

A "1" in a column indicates that the tag (e.g., "Supervisor≠Smith") is used in the combination, and a "0" in a column indicates that the logical inverse of the tag (e.g., "˜(Supervisor≠Smith)") is used in the combination. For example, the fifth row contains "110," which indicates that tag₁ and tag₂ are in the combination and that the logical inverse of tag₃ is in the combination. A user would select the fifth row to specify a selection query that selects those data items that satisfy the condition of tag₁ and the condition of tag₂ and the logical inverse of the condition of tag₃ (i.e., tag₁ AND tag₂ AND ˜tag₃). A user would select both the fourth and fifth rows to specify a selection query which selects those data items that satisfy the condition of tag₃ and that satisfy the logical inverse of the conditions of tag₁ and tag₂ and which selects those data items that satisfy the conditions of tag₁ and tag₂ and that satisfy the logical inverse of the condition of tag₃. The selection query is thus the logical-AND of the conditions indicated in a selected row and the logical-OR of the selected rows. In one embodiment, each tag is assigned a unique icon. The VQL system indicates the logical inverse of the condition of a tag in a row by the absence of the icon for that tag in the row. In addition, it is desirable that the icon assigned to a tag be suggestive of the condition of the tag. For example, an icon in the shape of a dollar sign might suggest that the tag represents a condition that an employee's salary is above a certain dollar amount. The use of a selection query grid is desirable for several reasons. First, the user can consider the data items in the collection as having these various tags assigned to them. Thus, the user simply selects those tagged data items when selecting the rows of the selection grid. Second, the user is presented with all possible combinations of the defined tags and simply needs to select the desired combination of tags. The user does not need to re-enter any conditions or tag identifiers. Third, the user does not need to be knowledgeable about Boolean logic. Rather, the user simply specifies to select data items with various combinations of tags. Fourth, as discussed below, a tag can represent a very complex condition. However, the selection query grid hides this complexity by displaying only an icon that represents even complex conditions.

FIG. 3 is a diagram illustrating an example of how a user uses the VQL system to define a tagged retrieval type. In this example, the user has specified to define a tagged retrieval type (i.e., tag) for the employee table. The VQL system displays screen 300 to allow the user to define a new tag for the employee table. The screen contains a tag definition list 301, a field scroll box 302, a relations list 303, and a value field 304. The tag definition list indicates that one tag is currently defined for the employee table. The defined tag represents the condition "Department-Marketing" and has been assigned an icon that is a check mark with a subscript of one (.check mark.₁). The field scroll box, the relations list, and the value field are used by the user to specify the condition for the tag being defined. In one embodiment, the VQL system automatically assigns a .check mark.₂ as the icon for the tag to be defined. To define the new tag, the user scrolls through the field scroll box until the desired field is shown. In this example, the user has selected the supervisor field as indicated by the shading. In response to the selection of the supervisor field, the VQL system displays the relations list with the relations that are appropriate for the selected field. Since supervisor is a text field, text-related relations such as equal to ("=") are displayed. If a numeric field were selected, then the relations (e.g., "<") appropriate for a numeric field would be displayed. In this example, the user has selected the not equal relation as indicated by the shading. The user then enters a value in the value field. In this example, the user has entered "Smith." The user would then select a button (not shown) to indicate that the definition is complete. The VQL system then updates the tag definition list with the newly defined tag (i.e., "Supervisor≠Smith"). In alternate embodiments, the VQL system may automatically assign tags of different colors or different shapes. The VQL system may also prompt the user for an indication of the icon to be assigned to a newly defined tag. Also, the VQL system may allow the user to enter text to describe the meaning of the tag, which may be displayed as a third column in the tag definition list.

FIG. 4 is a diagram illustrating another example of how a user uses the VQL system to define a tagged retrieval type. The tag definition list 401 indicates that two tags have been defined. In this example, the user has selected the region field in the field scroll box 402 as indicated by the shading. When the user selects the region field, the VQL system displays the relations list 403 and the value scroll box 404. The value scroll box contains the possible values for the region field. The user then selects the equals relation of the relations list and selects the "North America" value of the value scroll box. When the user indicates that the tag definition is complete, the VQL system updates the tag definition list to show the newly defined tag (i.e., "Region=North America"). Alternatively, the VQL system allows a user to enter a series of conditions and a tag is defined as the logical-OR of these conditions. For example, after the user selects the "North America" value, the user may then select the "Europe" value before indicating that the tag definition is complete. If the user then indicates that the tag definition is complete, then the defined tag will be "Region=North America OR Region=Europe."

FIG. 5 is a diagram illustrating the specifying of a selection query using a selection query grid. The VQL system displays the tag definition list 501 and the query selection grid 502. The tag definition list identifies the currently defined tags. The selection query grid contains eight rows arranged in two columns. Each row corresponds to a possible combination of the currently defined tags. The absence of an icon for a tag in a row indicates the logical inverse of the tag in the combination. Alternatively, each icon could be displayed in each row and the universal not symbol ("\◯") could be superimposed to indicate the logical inverse of a tag. Each row also contains an icon representing the collection of data to which the tags apply. In this example, the smiling face icon represents the employee table. However, such an icon representing a collection can also be omitted from the rows. To specify a selection query, a user selects rows of the selection query grid. The selection query is the logical-AND of the condition of each tag represented in a selected row and the logical-OR of the rows. For example, row 502d contains the icon (.check mark.₃) for tag₃. Thus, if the user selects only row 502d, the selection query will be the condition for tag₃ and the logical inverse of tag₁ and tag₂ (i.e., "Region=North America AND Department≠Marketing AND Supervisor=Smith"). If the user selects both rows 502d and 502e, then the selection query for row 502d is logically-OR'd with the selection query for row 502e. That is, the selection query will specify to select all employees in the North American region who are not in the marketing department and whose supervisor is Smith and to select all employees in not in the North American region who are in the marketing department and whose supervisor is not Smith. This selection query is represented by the following:

    (Department≠Marketing AND Supervisor=Smith AND Region=North America) OR

    (Department=Marketing AND Supervisor≠Smith AND Region≠North America)

As the number of defined tags increases, the number of rows in the selection query grid increases exponentially. Thus, in one embodiment, the VQL system can display the tag definition list and prompt the user to select which tags should be used to form the selection query grid. In this way, the user can limit the selection query grid to those tags that will be used to form the query.

FIG. 6A is a diagram illustrating an example of how a user uses the VQL system to define a compound tag. A compound tag is a tag that is defined using other tags. When a user selects to define a compound tag, the VQL system displays screen 600. The screen contains tag definition list 601 and contains the query selection grid 602. In this example, the user may select row 602d and row 602e as the definition for the fourth tag, which is the compound tag. Thus, the compound tag₄ represents the logical-AND of the logical inverse of the conditions of tag₁ and tag₂ and the condition of tag₃ logically-OR'd with the logical-AND of the conditions of tag₁ and tag₂ and the logical inverse of the condition of tag₃. FIG. 6B is a diagram illustrating the definition of the compound tag. Compound tags can be specified of arbitrary complexity. The use of a text description is especially useful to describe a compound tag. For example, a user may enter the text "Employees to be reviewed" to describe tag₄. As an alternative to using the selection query grid, the VQL system may allow a user to simply select a tag that can be used as the selection query. In this way, a user can define a tag representing a complex selection query once and use the tag many times without re-selecting rows from the selection query grid. The button at the bottom of screen 600 facilitates the selection of multiple rows of the selection query grid. The "Select All" button allows a user to select all the rows. The user can then de-select the rows that are not to be included in the selection query. The "Invert Selection" button allows a user to select all rows that are currently de-selected and de-select all rows that are currently selected. As described above, in one embodiment, the VQL system can allow a user to indicate which of the defined tags are to be used to form the query selection grid for the compound tags, rather than using all of the defined tags.

FIG. 7 is a diagram illustrating both suggestive icons for tags and exclusive tags. A suggestive icon is an icon whose shape, color, or other characteristic represents the meaning of the condition. For example, an icon of a skull and crossbones could represent a tag for an undesirable condition. Also, a red icon in the shape of a car could represent a condition of a red car, and a gray icon in the shape of a seat could represent a condition of a gray upholstery for a car seat. Exclusive tags represent conditions that cannot both be satisfied by a data item in the collection. For example, if a tag represents the condition that the department is marketing and another tag represents the condition that the department is accounting, these tags are exclusive because no employee can be in two departments at once. Consequently, the VQL system detects such exclusive tags and displays the selection query grid so that combinations with exclusive tags are omitted. In the example of FIG. 7, three tags have been defined indicating the media field is equal to disk, the media field is equal to CD, and the media field is equal to electronic. The shape of the icon is suggestive of the value for the field. It is desirable that suggestive tags be used when possible. In this example, the tags for the media field are exclusive. That is, the media field can only contain the value disk or CD or electronic but not a combination. Thus, the VQL system displays the selection query grid 702 that shows only four rows, rather than eight rows of all possible combinations. The rows containing impermissible combinations of these tags have been omitted. For example, the displaying of a row containing the disk and CD tags would be meaningless since no record could ever satisfy both conditions.

FIG. 8 is a diagram illustrating the relative preferences of tags. Information retrieval systems, such as search engines for the World Wide Web, may select vast numbers of documents that literally satisfy a selection query. For example, a selection query that selects all documents which contain the word "Caribbean" or the word "scuba" may result in hundreds of documents being retrieved. A user would typically like to have documents returned in the order of their relevance. The VQL system allows a user to specify a relative preference between tags that are combined into a selection query. For example, if the user may assign a higher preference to the word "Caribbean" and a lower preference to the word "scuba," which would mean that the user would prefer to have those documents that contain both words returned first, followed by those documents that contain the word "Caribbean" but not the word "scuba" and finally by those documents that contain the word "scuba" but not the word "Caribbean." Generally, each tag can be assigned a preference value between 0 and 1 and the relevance of a document can be computed by the following formula: ##EQU1## where R is the relevance of the document and P_(i) is the preference value of the i^(th) tag. Also, a preference value could be negative which would effectively reduce the overall relevance if a document satisfies the tag. Alternatively, the preference value P_(i) could be multiplied by the degree to which the i^(th) tag is satisfied by the document. For example, if the tag indicates the word "Caribbean," then the degree to which a document satisfies that tag may be the number of occurrences of the word "Caribbean" in that document divided by the number of words in the document.

In the example of FIG. 8, the icon for tag₁ is much larger than the icon for tag₂. When the user defined tag₁ and tag₂, the user indicated a higher preference for tag₁. Thus, the icon for tag₁ is larger, which provides a visual feedback of relative preference to the user. The relative size of icons can also be used to indicate relative preference in a "fuzzy" selection query. A fuzzy selection query is a selection query for which the selected data does not need to satisfy the conditions literally. Rather, a fuzzy selection query includes a preference for each of the tags in the selection query. For example, a database of the performance of mutual funds may contain fields such as type of mutual fund and performance for each year. A user may want to identify bond mutual funds whose net asset value has increased by an average of 10% in the last three years. However, the user may also be interested in non-bond mutual funds that have had exceptional performance in the last three years. The user would like to see the mutual funds listed based on how closely they match the user's preferences. To specify such a fuzzy query, a user would define a tag for the condition "type=bond" and a tag for the condition "performance>10% for last 3 years." The preference, as described above, for each tag could be a value between 0 and 1. The icons for the tags could be displayed in sizes based on their preference. A tag with a preference of 0.5 would have an icon that is one-half the size of the icon for a tag with a preference of 1. Also, a special icon could be used to specify the preference of each tag. For example, the icon of balanced scale (""), an apothecary weight (""), or dumbbell ("") can be displayed for each tag with a size indicating the relative preferences of the tags.

FIG. 9 is a block diagram of a computer system embodying the present invention. The computer system 900 contains central processing unit 901, I/O interface 902, memory 903, and display and input devices 904. The display and input devices may include a computer display, a keyboard, and a mouse. The memory may include removable media drives, such as a CD-ROM drive, which are capable of reading information stored in a computer-readable medium such as a CD-ROM. The memory contains a tag component 910, a selection query component 907, the tag database 908, and the collection database 909. The tag component contains a define simple tag component 905 and a define compound tag component 906. The define simple tag component controls the defining of simple tags. The define compound tag component controls the defining of compound tags. The selection query component controls the displaying of the selection query grid and inputting the selection. The VQL system stores the defined tags in the tag database 908. The selection query can be applied to a collection database 909 or could also be applied through I/O interface to an external system that may be connected via the Internet.

FIG. 10 is a flow diagram of an implementation of the tag component. This define tag routine displays the defined tags, receives an indication as to whether a tag is to be simple or compound, and invokes the appropriate routine to input the definition of the tag. In step 1001a, the routine displays the currently defined tags in a tag definition list. In step 1001b, the routine prompts the user for an optional description of the tag to be defined. In step 1002, if the user specifies to define a simple tag, then the routine continues at step 1003, else the routine continues at step 1004. In step 1003, the routine invokes the routine to define a simple tag. In step 1004, the routine invokes the routine to define a compound tag. In step 1005, if the user indicates that the definition of tags is complete, then the routine returns, else the routine loops to step 1001a to define a new tag.

FIG. 11 is a flow diagram of an implementation of a define simple tag routine. This example implementation supports defining tags for database tables. In step 1101, the routine displays the various fields of the database table in a field scroll box. In step 1102, the routine inputs a selection of a field. In step 1103, the routine displays the relations that are appropriate for the selected field. In step 1104, the routine inputs a selection of a relation. In step 1105, the routine inputs a value. In step 1106, the routine then adds the simple tag as a defined tag and returns. In alternate embodiments, the definition of a simple tag can include evaluations of multiple fields. For example, a simple tag for use in a credit rating system may be defined as "principal+interest>0.28*income." In such a case, the VQL system may allow the user to enter such a condition in an input field. The VQL system may check to ensure that names in the condition correspond to field names of the table.

FIG. 12 is a flow diagram of an implementation of a define compound tag routine. In step 1201, the routine displays the selection query grid. The routine optionally allows the user to indicate which of the defined tags should be used to form the selection query grid. In step 1202, the routine inputs the selection of rows. In step 1203, the routine adds the compound tag to the tag database and returns.

FIG. 13 is a flow diagram of an implementation of a selection query routine. The selection query routine allows a user to retrieve data based on a selection query. In step 1301, the routine displays the currently defined tags in a tag definition list. In step 1302, the routine displays the selection query grid for the currently defined tags. The routine optionally allows the user to indicate which of the defined tags should be used to form the selection query grid. In step 1303, the routine inputs a selection of rows from the selection query grid. In step 1306, the routine performs the selected query on the collection of data. In step 1305, the routine displays the results of the query and returns.

Although the present invention has been described in terms of one embodiment, it is not intended that the invention be limited to this embodiment. Modifications within the spirit of the invention would be apparent to those skilled in the art. The scope of the present invention is defined by the claims that follow. 

I claim:
 1. A method in a computer system for specifying a selection query for a collection of data items, the method comprising:defining a plurality of tags, each tag specifying a condition with respect to the collection of data; assigning a unique icon to each defined tag; displaying a selection query grid having rows for possible combinations of the defined tags and logical inverse of the defined tags, each row displaying the unique icons representing the defined tags or the logical inverse of the defined tags in the combination; and receiving a selection of one or more rows, the selected rows indicating the combinations of defined tags that form the selection query wherein the selection query indicates to select each data item that satisfies the condition in at least one selected combination.
 2. The method of claim 1, including displaying an indication of the condition specified by each tag.
 3. The method of claim 1 wherein after receiving a selection of one or more rows, receiving an indication to invert the selection so that all rows that were previously not selected are now selected and all rows that were previously selected are now not selected.
 4. The method of claim 1 wherein each icon has a similar shape but a different color.
 5. The method of claim 1 wherein each icon has a certain characteristic with one of a plurality of attribute values and wherein the receiving of a selection of one or more rows includes receiving an indication that all rows that display an icon with a certain attribute should be selected.
 6. The method of claim 5 wherein the certain characteristic is color and the attribute is the color of the icon.
 7. The method of claim 1 wherein the defining of tags includes defining a condition using previously defined tags.
 8. The method of claim 7 wherein the defining of a condition using previously defined tags includes displaying a selection query grid having a row for various combinations of the defined tags and the logical inverse of the defined tags, each row displaying the unique icons representing the defined tags or the logical inverse of the defined tags in the combination and including receiving a selection of one or more rows, the selected rows indicating the combinations of tags that form the condition.
 9. The method of claim 1 wherein the assigning of a unique icon to each tag includes receiving from a user an indication of the icon to be assigned.
 10. The method of claim 1 wherein the receiving of a selection of one or more rows includes receiving an indication to select all rows with a certain tag present.
 11. The method of claim 1 wherein the collection is a table with records having fields with names and wherein the defining of a plurality of tags includes the displaying of names of the fields and possible relations and the receiving of a selection of a name of a field, a relation, and a value.
 12. The method of claim 1 wherein the collection is a collection of documents and data items are the documents, and wherein the relation includes an indication that a certain word within a document is used in proximity with another word.
 13. The method of claim 1 wherein a characteristic of an icon suggests the condition that the icon represents.
 14. The method of claim 1 wherein a tag is assigned a preference.
 15. The method of claim 14 wherein the preferences are indicated by the displaying the icon in varying sizes.
 16. The method of claim 1 wherein the rows include a row for each possible combination of tags.
 17. The method of claim 1 wherein rows for combinations of exclusive tags are not displayed.
 18. A method in a computer system for specifying a selection query for a collection of data items, the method comprising:defining a plurality of conditions that relate to the collection of data items; displaying a selection query grid having rows for possible combinations of the defined conditions and logical inverse of the defined conditions, each row indicating the possible combination; and receiving a selection of one or more rows, the selected rows indicating the combinations of conditions that form the selection query wherein the selection query indicates to select each data item that satisfies at least one combination of a selected row.
 19. The method of claim 18 wherein each defined condition is assigned a unique icon and the defined condition or the logical inverse of a defined condition in a combination is represented by the presence or absence of the icon in the row.
 20. The method of claim 18 wherein when no data item can satisfy a certain combination of conditions, a row representing that combination is not displayed.
 21. The method of claim 18 wherein the selection query grid includes a row for each possible combination of the defined conditions.
 22. The method of claim 18 wherein the selection query is the logical-AND of defined conditions and of the logical inverse of defined conditions of each selected row and the logical-OR of the conditions of each row.
 23. The method of claim 18 wherein a condition is defined in terms of other defined conditions.
 24. The method of claim 23 wherein a condition is defined in terms of other defined conditions by selecting rows of a displayed selection query grid.
 25. The method of claim 18 wherein each condition is assigned an icon that is suggestive of a meaning of the condition.
 26. The method of claim 18 wherein after receiving a selection of one or more rows, receiving an indication to invert the selection so that all rows that were previously not selected are now selected and all rows that were previously selected are now not selected.
 27. The method of claim 18 wherein icons are automatically assigned to each condition.
 28. The method of claim 18 wherein a user assigns an icon to each condition.
 29. The method of claim 18 wherein the conditions are assigned a preference indicating ordering in which selected data items are to be retrieved.
 30. The method of claim 29 wherein the conditions are assigned icons and the size of the icon is based on the assigned preference.
 31. The method of claim 18 wherein the collection of data items is assigned an icon and the icon is displayed in each row.
 32. A computer-readable medium containing instructions for causing a computer system to receive a specification of a selection, by:defining a plurality of conditions; displaying a selection query grid having rows for possible combinations of the defined conditions, each row indicating the defined conditions in one of the combinations; and receiving a selection of one or more rows, the selected rows indicating the combinations of conditions that form the selection query.
 33. The computer-readable medium of claim 32 wherein each defined condition is assigned a unique icon and the defined condition or the logical inverse of the defined condition in a combination is represented by the presence or absence of the icon in the row.
 34. The computer-readable medium of claim 32 wherein when no data item can satisfy a certain combination of conditions, a row representing that combination is not displayed.
 35. The computer-readable medium of claim 32 wherein each defined condition is assigned a unique icon and the defined condition or logical inverse of the defined condition in a combination is represented by the icon without a logical inverse symbol or by the icon with a logical inverse symbol.
 36. The computer-readable medium of claim 32 wherein the selection query is the logical-AND of the defined conditions or logical inverse of the defined conditions of each selected row and the logical-OR of the conditions of each row.
 37. The computer-readable medium of claim 32 wherein a condition is defined in terms of other defined conditions.
 38. The computer-readable medium of claim 37 wherein a condition is defined in terms of other defined conditions by selecting rows of a displayed selection query grid.
 39. The computer-readable medium of claim 32 wherein each condition is assigned an icon that is suggestive of a meaning of the condition.
 40. The computer-readable medium of claim 32 wherein after receiving a selection of one or more rows, receiving an indication to invert the selection so that all rows that were previously not selected are now selected and all rows that were previously selected are now not selected.
 41. The computer-readable medium of claim 32 wherein icons are automatically assigned to each condition.
 42. The computer-readable medium of claim 32 wherein a user assigns an icon to each condition.
 43. The computer-readable medium of claim 32 wherein the conditions are assigned a preference indicating ordering in which selected data items are to be retrieved.
 44. The computer-readable medium of claim 43 wherein the conditions are assigned icons and the size of the icon is based on the assigned preference.
 45. The computer-readable medium of claim 32 wherein the collection of data items is assigned an icon and the icon is displayed in each row.
 46. A computer system for specifying a selection query, comprising:a tag component for inputting a definition a plurality of conditions; and a selection query component for displaying in a selection query grid possible combinations of the defined conditions and for receiving a selection of the displayed combinations wherein the selected combination forms the selection query.
 47. The computer system of claim 46 wherein the defined condition or logical inverse of the defined condition is indicated by display of an icon assigned to the condition without or with a logical inverse symbol.
 48. The computer system of claim 46 wherein the selection query is the logical-AND of each defined condition and of the logical inverse of each defined condition in a selected combination and a logical-OR of the selected combinations.
 49. The computer system of claim 46 wherein a condition is defined in terms of other conditions by selecting displayed combinations of previously defined conditions. 